import Vue from 'vue' // 导入Vue
import VueRouter from 'vue-router' // 导入路由
//配置路由


// 导入需要配置路由的组件
import Login from '../pages/Login.vue'
import User from '../pages/User.vue'
import HomePage from '../pages/HomePage.vue'
import AddUser from '../pages/AddUser.vue'
import UpdateUser from '../pages/UpdateUser'
import Date from '../pages/Date.vue'
import Insect from '../pages/Insect.vue'
import InsectInfo from '../pages/InsectInfo.vue'
Vue.use(VueRouter) // vue 使用 vue-router

// 定义路由和组件的映射
const routes = [
    // path 表示url或路径   component 表示该url对应的组件
    {path:"/login",name:'登录',component:Login },
    {path:"/User",name:"用户页",component:User},
    {path:"/HomePage",name:"主页",component:HomePage},
    {path:"/addUser",name:"添加用户",component:AddUser},
    {path:"/UpdateUser",name:"修改用户",component:UpdateUser},
    {path:"/Date",name:"日志管理",component:Date},
    {path:"/Insect",name:"虫害一览",component:Insect},
    {path:"/InsectInfo",name:"虫害一览详情",component:InsectInfo},
]
// 创建路由对象
export default new VueRouter({
    mode:"history",
    routes
})






